﻿<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right" for="temp">表单:</label>
    <div class="col-sm-9">
        <input type="text" style="width:9em;" id="tempSelector" name="temp" placeholder="表单模板" class="input-medium tm-input tm-input-success tm-input-typeahead">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right">处理者:</label>
    <div class="col-sm-9">
        <input type="text" autocomplete="off" id="operatorSelector" placeholder="请输入姓名" style="width:9em;" class="input-medium tm-input tm-input-success tm-input-typeahead" data-type="user" data-original-title="" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right" for="tag">备注:</label>
    <div class="col-sm-9">
        <input type="text" id="tag" name="tag" placeholder="备注" class="col-xs-12 col-sm-9">
    </div>
</div>

<script>
    function initForm() {
        $("#tag").val(selNode.opt.tag);
        initUserList("#operatorSelector", selNode.opt.operators, {
            hiddenTagListName: "operatorSelector"
        });
        initFormTemplateList("#tempSelector", selNode.opt.formTemplate, {
            hiddenTagListName: "tempSelector",
            maxTags: 1
        });
    }
    function saveForm() {
        selNode.opt.tag = $("#tag").val();
        selNode.opt.operators = $("[name = 'operatorSelector']").val();
        selNode.opt.formTemplate = $("[name = 'tempSelector']").val();
    }
    initForm();
</script>